<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <head>
        <title>Search Event By Name</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    </head>
    <body>

        <f:view>
            <h:form>
                <h1><h:outputText value="Event Searched:"/></h1>
                <h:dataTable binding="#{eventshowbean.datatable}" value="#{eventshowbean.searchAllEvents()}" var="item">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Name"/>
                        </f:facet>
                        <h:outputText value="#{item.name}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Location"/>
                        </f:facet>
                        <h:outputText value="#{item.location}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="StartDateTime"/>
                        </f:facet>
                        <h:outputText value="#{item.startDateTime}">
                            <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="EndDateTime"/>
                        </f:facet>
                        <h:outputText value="#{item.endDateTime}">
                            <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Privacy"/>
                        </f:facet>
                        <h:outputText value="#{item.privacy}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Type"/>
                        </f:facet>
                        <h:outputText value="#{item.type}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Organizer"/>
                        </f:facet>
                        <h:outputText value="#{item.organizer}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="What to do" />
                        </f:facet>
                        <h:commandButton value="Show Event"
                                         action="#{eventshowbean.showEvent}" />
                    </h:column>
                </h:dataTable>
            </h:form>
        </f:view>


    </body>
</html>
